# -*- coding:utf-8 -*-

#def calc(numbers):
#    sum = 0
#    for x in numbers:
#        sum = sum + x * x
#    return sum
#
#print calc([10,20,30])

def calc(*numbers):
    sum = 0
    for x in numbers:
        sum = sum + x * x
    return sum

print calc(1,2,2,3,4,6)

def person(name, age, **kw):
    print 'name:',name,'age:',age,'other:',kw

person('Michael',30, city='Beijing')

kw = {'city': 'Beijing','job': 'Engineer'}
person('Jack', 24, city=kw['city'], job=kw['job'])
person('Jack', 24, **kw)

def person(a, b, c=0, *args, **kw):
    print 'a =',a,'b =',b,'c =',c,'args =',args,'kw =',kw

person(1,2)
person(1,2,c=3)
person(1,2,3,'a','b','c',x=1)
